<template>
	<view class="word-container">
		<view class="word-panel">
			<view class="wordItem">每日一言</view>
			<view>作者:{{this.author}}</view>
			<view>内容:{{this.content}}</view>
			<view>时间:{{this.date}}</view>
			<view>职业:{{this.from}}</view>
		</view>		
	</view>
</template>

<script>
	import service from '../../utils/http.js'
	export default {
		data() {
			return {
				info: {},
				author: '',
				content: '',
				date: '',
				from: '',
				pic_url: '',
				thumb: ''
			};
		},
		onLoad() {
			this.getWord()
		},
		methods: {
			getWord() {
				service.get('api/common/yiyan').then(response => {
					this.info = response.result
					this.author = this.info.author
					this.content = this.info.content
					this.date = this.info.date
					this.from = this.info.from
				}).catch(error => {
					console.error(error);
				})
			}
		}
	}
</script>

<style lang="scss">
	.word-container {
		display: flex;
		flex-direction: row;
		justify-content: center;
		line-height: 40px;
		.wordItem{
			display: flex;
			align-items: center;
			justify-content: center;
			padding-top: 20px;
		}
	}
</style>